﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.EquipmentManagement;
using Digitalmes.Model;

namespace Digitalmes.ViewModel.EquipmentManagement.ConsumableUsageVMs
{
    public partial class ConsumableUsageTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._ConsumableUsage._Record")]
        public ExcelPropety Record_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.RecordId);
        [Display(Name = "_Model._ConsumableUsage._MaterialId")]
        public ExcelPropety MaterialId_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.MaterialId);
        [Display(Name = "_Model._ConsumableUsage._MaterialName")]
        public ExcelPropety MaterialName_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.MaterialName);
        [Display(Name = "_Model._ConsumableUsage._Specification")]
        public ExcelPropety Specification_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.Specification);
        [Display(Name = "_Model._ConsumableUsage._Quantity")]
        public ExcelPropety Quantity_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.Quantity);
        [Display(Name = "_Model._ConsumableUsage._Unit")]
        public ExcelPropety Unit_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.Unit);
        [Display(Name = "_Model._ConsumableUsage._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.CreateTime, true);
        [Display(Name = "_Model._ConsumableUsage._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.UpdateTime, true);
        [Display(Name = "_Model._ConsumableUsage._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.CreateBy);
        [Display(Name = "_Model._ConsumableUsage._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.UpdateBy);
        [Display(Name = "_Model._ConsumableUsage._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.IsValid);
        [Display(Name = "_Model._ConsumableUsage._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<ConsumableUsage>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Record_Excel.DataType = ColumnDataType.ComboBox;
            Record_Excel.ListItems = DC.Set<MaintenanceRecord>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ConsumableUsageImportVM : BaseImportVM<ConsumableUsageTemplateVM, ConsumableUsage>
    {
            //import

    }

}